<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:thSys="">
<head>
<meta charset="UTF-8">
<title>pinghsu主题设置</title>
<link rel="stylesheet" type="text/css"
	href="/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/plugins/vali/css/main.css">
<link rel="stylesheet" type="text/css"
	href="/plugins/toast/jquery.toast.css">
</head>
<body>
	<div class="col-md-12">
		<div class="row">
			<div class="col-lg-6 mt-3">
				<img alt="" class="img-thumbnail img-fluid"
					th:src="${theme.themeImg}">
			</div>
			<div class="col-lg-6 mt-3" >
				<div class="bs-component tile">
					<ul class="nav nav-tabs" role="tablist">
						<li class="nav-item"><a class="nav-link active"
							data-toggle="tab" href="#sns">社交资料</a></li>
						<li class="nav-item"><a class="nav-link" data-toggle="tab"
							href="#about">关于</a></li>
					</ul>
					<!-- Tab panes -->
					<div class="tab-content">
						<div id="sns" class="container tab-pane active">
							<form class="form-horizontal" id="snsOptions">
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">RSS：</label>
							<div class="col-md-8 mt-2">
										<label> <input type="radio" th:value="rss_open"
											name="pinghsu_rss"
											th:checked="${options['pinghsu_rss'] == 'rss_open'}" checked="checked"/><span
											class="label-text font-weight-bold">显示</span>
										</label> <label><input type="radio" th:value="rss_close"
											name="pinghsu_rss"
											th:checked="${options['pinghsu_rss'] == 'rss_close'}"
											/><span class="label-text font-weight-bold">隐藏</span>
										</label>
									</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">Weibo：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_weibo']}" name="pinghsu_weibo">
							</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">GitHub：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_github']}" name="pinghsu_github">
							</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">Zhihu：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_zhihu']}" name="pinghsu_zhihu">
							</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">Twitter：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_twitter']}" name="pinghsu_twitter">
							</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">QQ：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_qq']}" name="pinghsu_qq">
							</div>
						</div>
						<div class="form-group row mt-3">
							<label class="col-form-label col-md-4 font-weight-bold">Email：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" th:value="${options['pinghsu_email']}" name="pinghsu_email">
							</div> 
						</div>
						<div class="form-group row">
								<div class="col-md-8 offset-md-10 ml-auto">
									<button class="btn btn-outline-primary float-right" type="button" onclick="save('snsOptions')">
										<i class="fa fa-fw fa-lg fa-check-circle"></i>保存设置
									</button>
								</div>
							</div>
						</form>
						</div>
						<div id="about" class="tab-pane fade">
						 <div class="list-group">
                         <a class="list-group-item list-group-item-action" target="_blank" href="https://www.linpx.com/">作者主页</a>
                         <a class="list-group-item list-group-item-action" target="_blank" href="https://github.com/chakhsu/pinghsu">原主题地址</a>
                         </div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="/plugins/vali/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="/plugins/vali/js/bootstrap.min.js"></script>
	<script type="text/javascript"
		src="/plugins/vali/js/plugins/pace.min.js"></script>
	<script type="text/javascript" src="/js/mayday.js"></script>
	<script type="text/javascript" src="/plugins/toast/jquery.toast.js"></script>
	<script type="text/javascript" src="/static/plugins/layer/layer.js"></script>
	<script type="text/javascript">
	//保存设置项
	 function save(id){
		var from =$("#"+id).serialize();
		$.ajax({
			type:"post",
			async: false,
			url:"/admin/option/save",
			data:from,
			dataType:"json",
			success:function(data){
				showMsg(data.msg,"success",3000)
			}
		});
	}
	</script>
</body>
</html>